package com.xai.pg.data;

import com.xai.pg.util.Convert;

/**
 * @Author xxx
 * @Date 2018-12-24 14:13:42
 * @Desc DBFiled
 *
 */
public class DBField {

    private String name;
    private String desc;
    private String type;
    private String columnDefault;
    private boolean nullable;
    private Integer columnLength;
    private boolean pri;

    private String cName;
    private String uName;
    private String cType;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        if (name != null) {
            String str = Convert.up(name, false);
            this.setcName(str);
            String str1 = Convert.up(name, true);
            this.setuName(str1);
        }
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
        this.setcType(Convert.convert(type));
    }

    public String getcName() {
        return cName;
    }

    public void setcName(String cName) {
        this.cName = cName;
    }

    public String getcType() {
        return cType;
    }

    public void setcType(String cType) {
        this.cType = cType;
    }

    public String getuName() {
        return uName;
    }

    public void setuName(String uName) {
        this.uName = uName;
    }

    public String getColumnDefault() {
        return columnDefault;
    }

    public void setColumnDefault(String columnDefault) {
        if (!"CURRENT_TIMESTAMP".equalsIgnoreCase(columnDefault)) {
            this.columnDefault = columnDefault;
        }
    }

    public boolean isNullable() {
        return nullable;
    }

    public void setNullable(boolean nullable) {
        this.nullable = nullable;
    }

    public Integer getColumnLength() {
        return columnLength;
    }

    public void setColumnLength(Integer columnLength) {
        this.columnLength = columnLength;
    }

    public boolean isPri() {
        return pri;
    }

    public void setPri(boolean pri) {
        this.pri = pri;
    }
}
